<template>
  <div class="weihu">
    <ul>
      <li class="split" v-for="(item,index) in weihuData" :key="index">
        <!-- <head-desc v-if="flag" :bgImage="item.head_pic" :name="item.name" :address="item.areas_name" :tel="item.phone" :timer="item.created_at"></head-desc> -->
        <div @click="$router.push(`/weihuDetail/${item.id}`)">
          <p class="text">{{item.content}}</p>
          <list-images v-if="flag" :listImage = "item.img" :count="3"></list-images>
        </div>
        <p class="read-count">浏览量：{{item.reading_amount}}</p>
      </li>
    </ul>
    <back-top></back-top>
  </div>
</template>

<script>
import listImages from '../common/listImages'
import headDesc from '../common/headDisc'
import backTop from '../common/backTop'
import {getWeiHuData} from '../../api/supervisor'
const SUCCESS = 200
// const FAIL = 400
export default {
  data () {
    return {
      weihuData: [],
      flag: true
    }
  },
  created () {
    this._getWeiHuData()
  },
  components: {
    listImages,
    headDesc,
    backTop
  },
  methods: {
    _getWeiHuData () {
      getWeiHuData().then(res => {
        if (res.code === SUCCESS) {
          this.weihuData = res.data.data
          this.flag = true
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
  .weihu{
    width: 100%;
    padding-top: 44px;
    .split{
      border-bottom: 10px solid #f2f2f2;
      .text{
        padding: 5px 10px;
        line-height: 16px;
      }
    }
    .read-count{
      padding: 0 10px;
      height: 26px;
      line-height: 26px;
      text-align: right;
      font-size: 13px;
      color: #888;
    }
  }
</style>
